{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    }
   ],
   "source": [
    "%pylab inline\n",
    "import matplotlib.pyplot as plt\n",
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import numpy.random as rng\n",
    "import pandas_datareader.data as web\n",
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_prices(symbol):\n",
    "    start, end = '2007-05-02', '2016-04-11'\n",
    "    data = web.DataReader(symbol, 'google', start, end)\n",
    "    data=pd.DataFrame(data)\n",
    "    prices=data['Close']\n",
    "    prices=prices.astype(float)\n",
    "    return prices\n",
    "\n",
    "def get_returns(prices):\n",
    "        return ((prices-prices.shift(-1))/prices)[:-1]\n",
    "    \n",
    "def get_data(list):\n",
    "    l = []\n",
    "    for symbol in list:\n",
    "        rets = get_returns(get_prices(symbol))\n",
    "        l.append(rets)\n",
    "    return np.array(l).T\n",
    "\n",
    "def sort_data(rets):\n",
    "    ins = []\n",
    "    outs = []\n",
    "    for i in range(len(rets)-100):\n",
    "        ins.append(rets[i:i+100].tolist())\n",
    "        outs.append(rets[i+100])\n",
    "    return np.array(ins), np.array(outs)\n",
    "        \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "symbol_list = ['C', 'GS']\n",
    "rets = get_data(symbol_list)\n",
    "ins, outs = sort_data(rets)\n",
    "ins = ins.transpose([0,2,1]).reshape([-1, len(symbol_list) * 100])\n",
    "div = int(.8 * ins.shape[0])\n",
    "train_ins, train_outs = ins[:div], outs[:div]\n",
    "test_ins, test_outs = ins[div:], outs[div:]\n",
    "\n",
    "#normalize inputs\n",
    "train_ins, test_ins = train_ins/np.std(ins), test_ins/np.std(ins)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "sess = tf.InteractiveSession()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "positions = tf.constant([-1,0,1]) \n",
    "num_positions = 3\n",
    "\n",
    "x = tf.placeholder(tf.float32, [None, len(symbol_list) * 100])\n",
    "y_ = tf.placeholder(tf.float32, [None,  len(symbol_list)])\n",
    "\n",
    "W = tf.Variable(tf.random_normal([len(symbol_list) * 100, num_positions * len(symbol_list)]))\n",
    "b = tf.Variable(tf.random_normal([num_positions * len(symbol_list)]))\n",
    "\n",
    "y = tf.matmul(x, W) + b \n",
    "\n",
    "\n",
    "# loop through symbol, taking the columns for each symbol's bucket together\n",
    "pos = {}\n",
    "symbol_returns = {}\n",
    "relevant_target_column = {}\n",
    "for i in range(len(symbol_list)):\n",
    "    # isolate the buckets relevant to the symbol and get a softmax as well\n",
    "    symbol_probs = y[:,i*num_positions:(i+1)*num_positions]\n",
    "    symbol_probs_softmax = tf.nn.softmax(symbol_probs) # softmax[i, j] = exp(logits[i, j]) / sum(exp(logits[i]))\n",
    "    # sample probability to chose our policy's action\n",
    "    sample = tf.multinomial(tf.log(symbol_probs_softmax), 1)#sample = tf.argmax(symbol_probs_softmax, 1) #use a real sample\n",
    "    pos[i] = tf.reshape(sample, [-1]) - 1   # choose(-1,0,1)\n",
    "    # get returns by multiplying the policy (position taken) by the target return for that day\n",
    "    symbol_returns[i] = tf.multiply(tf.cast(pos[i], float32),  y_[:,i])\n",
    "    # isolate the probability of the selected policy (for use in calculating gradient)\n",
    "    sample_mask = tf.reshape(tf.one_hot(sample, 3), [-1,3])\n",
    "    relevant_target_column[i] = tf.reduce_sum(symbol_probs_softmax * sample_mask,1) # should be relevant to SAMPLE\n",
    "    \n",
    "# calculate the PERFORMANCE METRICS for the data chosen\n",
    "daily_returns_by_symbol = tf.concat(axis=1, values=[tf.reshape(t, [-1,1]) for t in symbol_returns.values()])\n",
    "daily_returns = tf.reduce_sum(daily_returns_by_symbol,1)/2\n",
    "total_return = tf.reduce_prod(daily_returns + 1)\n",
    "ann_vol = tf.multiply(\n",
    "    tf.sqrt(tf.reduce_mean(tf.pow((daily_returns - tf.reduce_mean(daily_returns)),2))) ,\n",
    "    np.sqrt(252)\n",
    "    )\n",
    "sharpe = total_return / ann_vol\n",
    "\n",
    "# CROSS ENTROPY\n",
    "training_target_cols = tf.concat(axis=1, values=[tf.reshape(t, [-1,1]) for t in relevant_target_column.values()])\n",
    "ones = tf.ones_like(training_target_cols)\n",
    "gradient = tf.nn.sigmoid_cross_entropy_with_logits(labels=training_target_cols, logits=ones)\n",
    "\n",
    "# COST\n",
    "# how should we do this step? it depends how we want to group our results. Choose your own adventure here by uncommenting a cost fn\n",
    "# this is the most obvious: we push each weight to what works or not. Try it out...we're gonna be RICH!!!! oh, wait...\n",
    "#cost = tf.multiply(gradient , daily_returns_by_symbol)\n",
    "# this takes the overall daily return and pushes the weights so that the overall day wins. Again, it overfits enormously\n",
    "#cost = tf.multiply(gradient , tf.reshape(daily_returns,[-1,1]))\n",
    "# this multiplies every gradient by the overall return. If the strategy won for the past ten years, we do more of it and vice versa\n",
    "cost = tf.multiply(gradient , total_return)\n",
    "costfn = tf.reduce_mean(cost)\n",
    "\n",
    "optimizer = tf.train.GradientDescentOptimizer(0.005).minimize(cost)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch: 5000 cost= 1.534477353 total return= 3.222245216\n",
      "Epoch: 10000 cost= 1.159810066 total return= 2.412446499\n",
      "Epoch: 15000 cost= 1.416095734 total return= 3.252466679\n",
      "Epoch: 20000 cost= 1.337784767 total return= 3.069759846\n"
     ]
    }
   ],
   "source": [
    "# initialize variables to random values\n",
    "init = tf.global_variables_initializer()\n",
    "sess.run(init)\n",
    "# run optimizer on entire training data set many times\n",
    "train_size = train_ins.shape[0]\n",
    "for epoch in range(20000):\n",
    "    start = rng.randint(train_size-50)\n",
    "    batch_size = rng.randint(2,20)\n",
    "    end = min(train_size, start+batch_size)\n",
    "    \n",
    "    sess.run(optimizer, feed_dict={x: train_ins[start:end], y_: train_outs[start:end]})#.reshape(1,-1).T})\n",
    "    # every 1000 iterations record progress\n",
    "    if (epoch+1)%5000== 0:\n",
    "        c,t = sess.run([costfn, total_return], feed_dict={x: train_ins, y_: train_outs})#.reshape(1,-1).T})\n",
    "        print(\"Epoch:\", '%04d' % (epoch+1), \"cost=\", \"{:.9f}\".format(c), \"total return=\", \"{:.9f}\".format(t-1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "# in sample results\n",
    "d, t = sess.run([daily_returns, gradient], feed_dict={x: train_ins, y_: train_outs})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1154de048>]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VNX9//HXyZ6QhQBhX8Iim4AsAQXcxQ3r0tbWvVqt\n9lurtbXLj6qtWm21rVttqy11rRW1VqxWXBAVQVAwLLIvYSdsAbJA9uX8/pibyUzWSWYymZm8n49H\nHty5c2fmk8vkPWfOPfdcY61FRETCX1RHFyAiIoGhQBcRiRAKdBGRCKFAFxGJEAp0EZEIoUAXEYkQ\nCnQRkQihQBcRiRAKdBGRCBETzBfr0aOHzczMDOZLioiEvRUrVhy21ma0tF1QAz0zM5Ps7OxgvqSI\nSNgzxuzyZTt1uYiIRAgFuohIhFCgi4hECAW6iE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4/H3O38Dptpp1EBzdQ7BNfR/a+A9bX7EegOfARsBRYA3Zz1BvirU+9a\nIKsD9nEX4AiQ5rEupPYvrg+b/UAlrr7Om9qyT3H1Xec4P98Ncr05uPqYa9/Hf3O2/abzXlkNrAQu\n9nieLFxBug34C85JikGqt9XvgWBlSGP1OutfAP6v3rYB3786U1REJEKEQ5eLiIj4QIEuIhIhFOgi\nIhFCgS4iEiEU6CIiEUKBLiISIRToIiIRQoEuIhIh/j/US3wbecaGGQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1154812b0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# equity curve\n",
    "plot(np.cumprod(d+1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "#out of sample results\n",
    "d, t = sess.run([daily_returns, gradient], feed_dict={x: test_ins, y_: test_outs})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x115422710>]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD8CAYAAABw1c+bAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4XNWZ+PHvmaJRL1az3G2wMa4U25gaei8JabCBAJuE\nZH/Jhixks8mmkA3JwmZJsmmbhA0lbBIICWQhlIDpEIoxuGDcG7ZkW8UqI2k0/fz+uEV3pBn10Ugz\n7+d59Fhz79Xo6Fp658x7znmP0lojhBAid7gy3QAhhBDjSwK/EELkGAn8QgiRYyTwCyFEjpHAL4QQ\nOUYCvxBC5BgJ/EIIkWMk8AshRI6RwC+EEDnGk+kGJFNVVaXnzJmT6WYIIcSk8fbbb7dorauHcu2E\nDPxz5sxh3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lmcd95uNd5vk5\nmWz/eFBKuZVS65VSj5uPs+LeZEXgV0q5gZ8DFwGLgKuVUosy26pxdx9wYZ9jXwWe01rPB54zH4Nx\nn+abHzcCvxinNmZKFLhFa70IWA183vz9yPX7EwLO1lovB44DLlRKrQb+A/iR1vpooA34lHn9p4A2\n8/iPzOuy3U3AVsfj7Lg3WutJ/wGcDDztePw14GuZblcG7sMcYLPj8Xagzvy8Dthufv4r4Opk1+XC\nB/AocJ7cn4R7Ugi8A5yEsSjJYx63/7YwduE72fzcY16nMt32NN6TGRgdgrOBxwGVLfcmK3r8wHTg\ngONxvXks19VqrQ+Znx8GrL39cvZ+mW/BjwfeRO6PlcrYADQBa4DdQLvWOmpe4vzZ7ftinu8AKse3\nxePqv4CvAHHzcSVZcm+yJfCLQWijK5LTU7iUUsXAw8CXtNZ+57lcvT9a65jW+jiM3u0qYGGGmzQh\nKKUuBZq01m9nui3pkC2BvwGY6Xg8wzyW6xqVUnUA5r9N5vGcu19KKS9G0P+d1voR87DcH5PWuh14\nASN9Ua6U8pinnD+7fV/M82XAkXFu6ng5FbhcKbUPeBAj3fNjsuTeZEvgfwuYb4645wFXAY9luE0T\nwWPAdebn12Hktq3jnzRnr6wGOhwpj6yjlFLA3cBWrfUPHady+v4opaqVUuXm5wUY4x5bMV4APmJe\n1ve+WPfrI8Dz5julrKO1/prWeobWeg5GPHlea/0JsuXeZHqQYQwHYi4GdmDkKL+e6fZk4Od/ADgE\nRDByj5/CyDE+B+wEngWmmNcqjFlQu4F3gRWZbn+a781pGGmcTcAG8+PiXL8/wDJgvXlfNgPfMo/P\nA9YCu4A/Aj7zeL75eJd5fl6mf4Zxuk9nAo9n072RlbtCCJFjsiXVI4QQYogk8AshRI6RwC+EEDlG\nAr8QQuQYCfxCCJFjJPALIUSOkcAvhBA5RgK/EELkmP8PczNAjIQzbV0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x115261898>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#out of sample results\n",
    "plot(np.cumprod(d+1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
